Communication Setting Technology and Communication Apparatus

ABSTRACT

A non-transitory computer-readable medium having a communication program stored thereon and readable by a controller of a communication apparatus, the communication program, when executed by the controller, causes the controller to perform: determining whether a wireless setting for performing wireless communication by the wireless communication method is set in an external apparatus when the communication apparatus is in communication with the external apparatus through the first communication unit; determining whether a wireless setting which is settable by the communication apparatus is stored in a storage; and transmitting the wireless setting stored in the storage to the external apparatus through the first communication unit when it is determined that the wireless setting is not set in the external apparatus and it is determined that the wireless setting that is settable by the communication apparatus is stored in the storage.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of prior U.S. application Ser. No.14/217,895, filed Mar. 18, 2014, which claims priority from JapanesePatent Application No. 2013-070378 filed on Mar. 28, 2013, the entiresubject matter of which is incorporated herein by reference.

TECHNICAL FIELD

The invention relates to a communication program and a communicationapparatus.

BACKGROUND

In a printer configured to perform a printing operation for a recordingsheet, there has been proposed a technology of transmitting/receivingprint data for printing by wireless communication. In this technology,the printer acquires print data from a PC, which is connected to a relayapparatus (for example, an access point) of wireless LAN, by wirelesscommunication through the relay apparatus of the wireless LAN thatcovers a using place of the printer, and executes a printing operationbased on the received print data.

SUMMARY

The printer that acquires the print data from the access point by thewireless communication should be wirelessly connected to the accesspoint so as to transmit/receive data. In order to set a wirelessconnection between the printer and the access point, it is necessary fora user to input a character string, for example, for the wirelessconnection from an operation terminal such as a PC connected to theprinter. Such an operation for setting the wireless connection is atroublesome for the user.

Therefore, illustrative aspects of the invention provide a communicationprogram and a communication apparatus capable of enabling a wirelesssetting for performing wireless communication by a wirelesscommunication method that is different from a near field communicationmethod to be easily set in an external apparatus.

According to one illustrative aspect of the invention, there is provideda non-transitory computer-readable medium having a communication programstored thereon and readable by a controller of a communicationapparatus, wherein the communication apparatus comprises: a firstcommunication unit configured to perform communication by a near fieldcommunication method; a second communication unit configured to performcommunication by a wireless communication method that is different fromthe near field communication method; a storage unit comprising a firststorage area that is allotted to the communication program; and thecontroller, the communication program, when executed by the controller,causes the controller to perform operations comprising: a firstdetermination process of determining whether a wireless setting forperforming wireless communication by the wireless communication methodis set in an external apparatus in a case where the communicationapparatus is in communication with the external apparatus through thefirst communication unit; a first storage determination process ofdetermining whether a wireless setting, which is settable by thecommunication apparatus, is stored in the first storage area; and awireless setting transmission process of transmitting the wirelesssetting stored in the first storage area to the external apparatusthrough the first communication unit in a case where the firstdetermination process determines that the wireless setting is not set inthe external apparatus and the first storage determination processdetermines that the wireless setting, which is settable by thecommunication apparatus, is stored in the first storage area.

Incidentally, the invention can be implemented by a variety of aspectssuch as a communication apparatus, a control device controlling thecommunication apparatus, a communication system, a communication method,a communication control program for controlling the communicationapparatus, a computer-readable medium having the communication controlprogram stored thereon, and the like.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing an electrical configuration of aportable device having a setting application mounted therein;

FIGS. 2A to 2C are flow charts showing WLAN setting processing, SSIDdesignation processing and SSID transmission processing, respectively;and

FIG. 3A is a flow chart showing printing processing of a secondillustrative embodiment, and FIG. 3B is a flow chart showing printingprocessing of a third illustrative embodiment.

DETAILED DESCRIPTION

Hereinafter, preferred illustrative embodiments of the invention will bedescribed with reference to the accompanying drawings. First, a firstillustrative embodiment will be described with reference to FIGS. 1 and2. FIG. 1 is a block diagram showing an electrical configuration of aportable device 10 having a setting application 12 c mounted thereinthat is an illustrative embodiment of the communication program of theinvention. The portable device 10 is able to perform wirelesscommunication (hereinafter, referred to as ‘Wi-Fi communication’) basedon Wi-Fi (registered trademark) standards with an external apparatussuch as a multi-functional peripheral apparatus (hereinafter, referredto as ‘MFP’) 100. As specifically described later, the portable device10 having the setting application 12 c mounted therein can easily set awireless setting for performing Wi-Fi communication in the MFP 100 inwhich the wireless setting for performing Wi-Fi communication is notset.

The portable device 10 of this illustrative embodiment is configured bya portable device such as a smart phone. The portable device 10 isprovided with a CPU (which is an abbreviation of “Central ProcessingUnit”) 11, a flash memory 12, a RAM (which is an abbreviation of “RandomAccess Memory”) 13, an operation key 15, an LCD (which is anabbreviation of “Liquid Crystal Display”) 16, a touch panel 17, a memorycard interface (memory card I/F) 18, a voice I/O (which is anabbreviation of “Input/Output”) unit 19, a telephone networkcommunication unit 20, a near field communication unit 22 and a wirelessLAN (which is an abbreviation of “Local Area Network”) communicationunit 23. The respective units are connected to each other by a bus line24.

The CPU 11 controls the respective units connected to the bus line 24 inresponse to fixed values or programs stored in the flash memory 12 andthe like. The flash memory 12 is a rewritable non-volatile memory. Theflash memory 12 stores therein an operating system 12 a (hereinafter,referred to as the OS 12 a) and the device control application 12 c. Inthe below, the CPU 11 that executes a program such as an application andan operating system may be simply described by a program name. Forexample, the description of ‘application’ may mean the ‘CPU 11 executingthe application’.

The OS 12 a is basic software for implementing standard functions of theportable device 10. In this illustrative embodiment, an Android(registered trademark) OS is adopted as the OS 12 a. The settingapplication 12 c is an application for setting a wireless setting forperforming Wi-Fi communication in the MFP 100 in which the wirelesssetting for performing Wi-Fi communication is not set. The respectiveprocessing shown in flow charts of FIGS. 2A to 2C is executed by the CPU11 in accordance with the setting application 12 c.

The flash memory 12 is provided with a storage area 12 b for an OS and astorage area 12 d for an application. The storage area 12 b for an OS isa storage area that is used by the OS 12 a and is allotted to the OS 12a. A variety of setting information set by the OS 12 a, for example, anSSID (Service Set Identifier) that is a wireless setting of the Wi-Ficommunication, and the like are stored in the storage area 12 b for anOS. On the other hand, the storage area 12 d for an application is astorage area that is used by the setting application 12 c and isallotted to the setting application 12 c. The wireless setting of theWi-Fi communication that is used by the setting application 12 c and issettable by the portable device 10, more specifically, an SSID of anaccess point (AP) 30 that is a relay apparatus is stored in the storagearea 12 d for an application. The RAM 13 is a rewritable volatile memoryhaving a temporary area for temporarily storing a variety of data whenthe CPU 11 executes the setting application 12 c and the like.

The operation key 15 is a mechanical key for inputting an instructionand the like to the portable device 10 and is provided to a housing ofthe portable device 10, for example. The LCD 16 is a liquid crystaldisplay apparatus for displaying a variety of screens. The touch panel17 is provided with overlapping with the LCD 16 and inputs aninstruction and the like to the portable device 10 when an indicatorsuch as a finger and a rod is touched or comes close thereto. The memorycard I/F 18 is an interface to which a rewritable non-volatile memorycard MC is mounted, and controls writing and readout of the data to andfrom the memory card MC. The voice I/O unit 19 is a device for voiceinput and output consisting of a microphone, a speaker and the like. Thetelephone network communication unit 20 is a circuit for communicationthrough a mobile telephone network (not shown).

The near field communication unit 22 is an interface for performingcommunication by near field communication having acommunication-possible distance such as a short distance of about 10 cm.In this illustrative embodiment, the near field communication that isperformed by the near field communication unit 22 is non-contactcommunication (hereinafter, the communication is referred to as ‘NFCcommunication’) conforming to NFC standards. In this illustrativeembodiment, the portable device 10 is able to perform the NFCcommunication with the MFP 100 having the near field communication unit122.

The wireless LAN communication unit 23 is an interface for performingwireless communication by the wireless LAN. In this illustrativeembodiment, the communication that is performed by the wireless LANcommunication unit 23 is wireless communication by the wireless LANbased on the standards of IEEE 802.11b/g. As described above, theportable device 10 is able to perform the Wi-Fi communication with theMFP 100 having the wireless LAN communication unit 23. Incidentally, acommunication-possible distance by the Wi-Fi communication is about 100m. The wireless LAN communication unit 23 is wirelessly connected to thewireless LAN communication unit 23 of the MFP 100 by any one mode of aninfrastructure mode and an ad hoc mode. The infrastructure mode is amode for wirelessly connecting the portable device 10 (the wireless LANcommunication unit 23) and the MFP 100 (a wireless LAN communicationunit 123) through the AP 30 that is a relay apparatus. On the otherhand, the ad hoc mode is a mode for wirelessly connecting the portabledevice 10 and the MFP 100 each other without using the AP 30. In thebelow, the wireless connection by the infrastructure mode is alsoreferred to as ‘infrastructure connection’ and the wireless connectionby the ad hoc mode is also referred to as ‘direct connection’.

The MFP 100 has a variety of functions such as printing, scan, copying,facsimile functions and the like. The MFP 100 has a printer unit, ascanner unit, a facsimile communication unit and the like (not shown)for implementing the various functions. The MFP 100 has a near fieldcommunication unit 122, like the near field communication unit 22. Also,the MFP 100 has a wireless LAN communication unit 123, like the wirelessLAN communication unit 23.

The AP 30 (30 a to 30 d) is a relay apparatus for relaying the Wi-Ficommunication between two apparatuses. The AP 30 is able to connect to anetwork 800. The AP 30 is able to connect to the other AP 30, a server(not shown) and the like through the network 800. As described above,the communication-possible distance of the Wi-Fi communication has alimit, such as about 100 m. Therefore, for example, as shown in FIG. 1,the portable device 10 and the MFP 100 are able to beinfrastructure-connected through the AP 30 in an area A within whichthey are able to perform communication with the AP 30 a by the Wi-Ficommunication. On the other hand, the portable device 10 and the MFP 100located in the area A are unable to be wirelessly connected to the APs30 b to 30 d located beyond the area A.

FIG. 2A is a flow chart showing WLAN (Wireless LAN) setting processing.This processing is processing that is executed by the CPU 11 of theportable device 10 in accordance with the setting application 12 c andis to set a wireless setting for performing Wi-Fi communication in theMFP 100 in which the wireless setting for performing Wi-Fi communicationis not set. This processing starts when the setting application 12 c isenabled to start up.

When this processing starts, the CPU 11 executes SSID designationprocessing (S201). The SSID designation processing (S201) is todesignate an SSID that is to be set in the MFP 100 and to set the SSIDas an SSID for transmission. The detailed processing thereof will bedescribed later with reference to FIG. 2B. After executing the SSIDdesignation processing (S201), the CPU 11 brings an antenna unit (notshown) of the near field communication unit 22 of the portable device 10close to an antenna unit (not shown) of the near field communicationunit 122 of the MFP 100, thereby displaying a user interface (UI)prompting a user to perform the NFC communication on the LCD 16 (S202).

Then, the CPU 11 waits for reception of an NFC event from the MFP 100(S203: No). The NFC event is an event that is transmitted from the MFP100 when the MFP 100 NFC-detects the portable device 10 as the antennaunit of the near field communication unit 22 of the portable device 10is enabled to come close to the antenna unit of the near fieldcommunication unit 122 of the MFP 100. In S203, when the CPU 11 receivesan NFC event (S203: Yes), the CPU 11 executes SSID transmissionprocessing (S204) and then ends this processing. The SSID transmissionprocessing (S204) is to control the transmission of the SSID set as theSSID for transmission in the SSID designation processing (S201). Thedetailed processing thereof will be described later with reference toFIG. 2C.

FIG. 2B is a flow chart showing the SSID designation processing (S201).When the CPU 11 determines that the SSID is stored in the storage area12 d for an application (S221: Yes), the CPU 11 determines whether thereis the transmitted SSID in the SSIDs stored in the storage area 12 d foran application (S222). In S222, the CPU 11 determines whether the SSIDhas been transmitted by determining whether a transmission flag is setfor the SSID. Specifically, the CPU 11 determines an SSID having atransmission flag set therein as the transmitted SSID and determinesthat an SSID having the transmission flag cleared is not the transmittedSSID. Incidentally, when storing a new SSID in the storage area 12 d foran application, the CPU 11 clears the transmission flag of the SSID.When the SSID is transmitted to the MFP 100 in the SSID transmissionprocessing (S204), which will be described later with reference to FIG.2C, the CPU 11 sets the transmission flag for the SSID. Incidentally,the set transmission flag may be cleared after predetermined timeelapses, for example in 10 minutes. Alternatively, the set transmissionflag may be appropriately cleared as the user performs a predeterminedoperation.

When the CPU 11 determines in S222 that the transmitted SSID is not inthe SSIDs stored in the storage area 12 d for an application (S222: No),the CPU 11 determines how many the SSIDs of a valid state are in theSSIDs stored in the storage area 12 d for an application (S223).Incidentally, the ‘SSID of a valid state’ indicates an SSID of the AP 30that can be wirelessly connected at a current position of the portabledevice 10. On the other hand, an SSID of the AP 30 that cannot bewirelessly connected at a current position of the portable device 10 isan ‘SSID of an invalid state’, not the valid state.

Specifically, the CPU 11 acquires from the OS 12 a an available (active)SSID of the wireless settings of the Wi-Fi communication, i.e., theSSIDs stored in the storage area 12 b for an OS. Then, the CPU 11compares the acquired SSID and the SSIDs stored in the storage area 12 dfor an application and determines a coinciding SSID as the SSID of avalid state and a non-coinciding SSID as the SSID of an invalid state.In S233, the CPU performs the determination for each of all the SSIDsstored in the storage area 12 d for an application and counts the numberof the SSIDs determined as the SSID of a valid state.

When the CPU 11 determines in S223 that one SSID of a valid state is inthe SSIDs stored in the storage area 12 d for an application (S223: 1),the CPU 11 sets the one SSID of a valid state as the SSID fortransmission (S224) and then ends this processing.

On the other hand, when the CPU 11 determines in S223 that a pluralityof SSIDs of a valid state is in the SSIDs stored in the storage area 12d for an application (S223: multiple), the CPU 11 displays a UI enablinga user to select one of the SSIDs of a valid state on the LCD 16 (S225).By the processing of S225, a list of the SSIDs of a valid state isdisplayed on the LCD 16, and the user can make an input of selecting oneSSID from the list. When the user makes an input of selecting one SSIDto the UI displayed by the processing of S225, the CPU 11 receives theselected one SSID (S226). Then, the CPU 11 sets the one SSID selected bythe user as the SSID for transmission (S224) and ends this processing.

When the CPU 11 determines in S223 that there is no SSID of a validstate in the SSIDs stored in the storage area 12 d for an application(S223: 0) or when the CPU 11 determines in S221 that there is no SSIDstored in the storage area 12 d for an application (S221: No), the CPU11 acquires an SSID of the AP 30 under connection from the OS 12 a(S227). Specifically, the CPU 11 acquires an SSID of the AP 30 underconnection from the SSIDs stored in the storage area 12 b for an OS inS227. Incidentally, the description ‘under connection’ indicates thatthe infrastructure connection is established between the wireless LANcommunication unit 23 and the AP 30. Then, the CPU 11 receives the userselection on one SSID of the AP 30 under connection and performspassword authentication for the selected SSID (S228). Specifically, inS228, the CPU 11 first displays the UI enabling the user to select oneSSID of the AP 30 under connection acquired from the OS 12 a on the LCD16 and thus prompts the user to select one SSID by operating the UI.Then, the CPU 11 displays a UI for inputting a password for the selectedSSID on the LCD 16 and performs the authentication on the basis of thepassword input to the UI by the user.

Then, the CPU 11 stores (saves) the one SSID authenticated in S228 andthe password corresponding to the SSID in the storage area 12 d for anapplication (S229). Thereby, the SSID of the AP 30 under connection,which is not stored in the storage area 12 d for an application butstored in the storage area 12 b for an OS, is stored in the storage area12 d for an application. Thereby, from next time, it is possible toperform Wi-Fi communication by using the SSID stored in this time or touse the SSID as an SSID to be transmitted to the MFP 100 in which theSSID is not set, without the user manually registering the SSID. Afterthe processing of S229, the CPU 11 sets the SSID, which is acquired fromthe OS 12 a and is password-authenticated, as the SSID for transmission(S224) and ends this processing.

Also, when the CPU 11 determines in S222 that there is the transmittedSSID in the SSIDs stored in the storage area 12 d for an application(S222: Yes), the CPU 11 sets the transmitted SSID as the SSID fortransmission (S224) and ends this processing. Incidentally, when thereis a plurality of the transmitted SSIDs, the CPU displays a UI enablingone SSID to be selected and prompts the user to select one SSID as atransmission target.

FIG. 2C is a flow chart showing the SSID transmission processing (S204).The CPU 11 sends an inquiry to the MFP 100 about a state of the wirelessconnection through the NFC communication (S241). In response to theinquiry, the MFP 100 checks whether the SSID of the AP 30 is set in theown apparatus and whether the set SSID is valid if the SSID of the AP 30is set and sends a result of the check back to the portable device 10through the NFC communication. Incidentally, the ‘SSID of a valid state’is indicative of the SSID of the AP 30 that can be wirelessly connectedat a current position of the MFP 100, like the portable device 10. Onthe other hand, the ‘SSID of an invalid state’ indicates the SSID of theAP 30 that cannot be wirelessly connected at a current position of theMFP 100, like the portable device 10.

The CPU 11 determines a state of the wireless connection of the MFP 100,based on the reply to the inquiry in S241 (S242). When the CPU 11determines in S242 that the SSID of the AP 30 is not set in the MFP 100or that the SSID of the AP 30 is set in the MFP 100 but is an SSID of aninvalid state (S242: non-setting or invalid), the CPU 11 transmits theSSID set as the SSID for transmission and the password corresponding tothe SSID to the MFP 100 through the NFC communication (S243). Then, theCPU 11 sets a transmission flag, which indicates the transmission, forthe transmitted SSID (S244) and ends this processing.

On the other hand, when the CPU 11 determines in S242 that the SSID ofthe AP 30 is set in the MFP 100 and is an SSID of a valid state (S242:valid), the CPU 11 displays a UI, which confirms whether the SSID set inthe MFP 100 may be switched, on the LCD 16 (S245). When the CPU 11receives a user input to the UI, which indicates that the switching ofthe SSID is permitted (S246: Yes), the CPU 11 proceeds to S243.Therefore, in this case, the SSID set as the SSID for transmission istransmitted to the MFP 100 through the NFC communication. On the otherhand, in S246, when the CPU 11 receives a user input indicating that theswitching of the SSID is not permitted (S246: No), the CPU 11 ends thisprocessing. Hence, when the user does not permit the switching of theSSID, the SSID set as the SSID for transmission is not transmitted tothe MFP 100 and the SSID of a valid state, which is currently set, inkept in the MFP 100, as it is.

According to the first illustrative embodiment, when the SSID is not setin the MFP 100, i.e., when the wireless communication by the Wi-Ficommunication is not set, or when the SSID of the AP 30 is set but is anSSID of an invalid state, if the SSID is stored in the storage area 12 dfor an application, the SSID is transmitted to the MFP 100 by the NFCcommunication. Hence, the MFP 100 can easily set the wireless settingfor performing Wi-Fi communication, i.e., the SSID, compared to aconfiguration where the user manually inputs and sets the SSID one byone. Also, since the SSID stored in the storage area 12 d for anapplication is a transmission target to the MFP 100, it is possible toset the SSID in the MFP 100 even when the SSID is not set in the OS 12a.

Specifically, the SSID is transmitted to the MFP 100 when the SSID isnot in the MFP 100 or when the set SSID is invalid. Hence, it ispossible to suppress the SSID of a valid state from being inadvertentlyrewritten with the SSID transmitted by the portable device 10 eventhough the SSID of a valid state is set in the MFP 100. On the otherhand, when the SSID of a valid state is set in the MFP 100, the portabledevice 10 asks the user if the SSID set in the MFP 100 may be switched.Then, only when the user permits, the SSID is transmitted to the MFP100. Therefore, even when the SSID of a valid state is set in the MFP100, it is possible to change the set SSID in accordance with anintention of the user.

Further, since the SSID, which is transmitted to the MFP 100, of theSSIDs stored in the storage area 12 d for an application is limited tothe SSID of the AP 30 of a valid state, i.e., to be currentlyconnectable, it is possible to perform Wi-Fi communication between theportable device 10 and the MFP 100 through the AP 30 that can becurrently connected. Still further, when a plurality of SSIDs of a validstate is stored in the storage area 12 d for an application, the usercan select one SSID, which is to be transmitted to the MFP 100, from themultiple SSIDs. Hence, it is possible to transmit an optimal SSID to theMFP 100, depending on the situations.

Further, when the SSID is not stored in the storage area 12 d for anapplication or when all the SSIDs stored in the storage area 12 d for anapplication are the SSIDs of an invalid state, the portable device 10acquires the SSID of the AP 30 under connection from the OS 12 a andtransmits the same to the MFP 100. Hence, it is possible to performWi-Fi communication between the portable device 10 and the MFP 100through the AP 30 under connection. Therefore, when the SSID is set inthe OS 12 a, it is possible to set an SSID in the MFP 100 by using theset SSID.

Further, since the SSID having a transmission flag set thereto of theSSIDs stored in the storage area 12 d for an application is to betransmitted to the MFP 100, it is possible to transmit the same SSID tothe different MFP 100. Thereby, when it is intended to connect thedifferent MFP 100 to the same SSID, i.e., the same AP 30, it is possibleto easily set the wireless setting.

Subsequently, a second illustrative embodiment will be described withreference to FIG. 3A. In the first illustrative embodiment, the settingapplication 12 c is configured as the dedicated application for settingthe wireless setting for performing Wi-Fi communication in the MFP 100in which the wireless setting for performing Wi-Fi communication is notset. On the other hand, the setting application 12 c of the secondillustrative embodiment is configured to also serve as an applicationfor using the printing function of the MFP 100. In the secondillustrative embodiment, the same parts as the first illustrativeembodiment are denoted with the same reference numerals and thedescriptions thereof are omitted.

FIG. 3A is a flow chart showing printing processing. This processing isprocessing that is executed by the CPU 11 of the portable device 10 inaccordance with the setting application 12 c of the second illustrativeembodiment, and is to transmit print data to the MFP 100 and to enablethe printing function of the MFP 100 to execute the printing based onthe print data. This processing starts when the setting application 12 cis enabled to start up and the image data is selected as a print target.

When this processing starts, the CPU 11 executes the SSID designationprocessing (S201) and displays the UI prompting the user to perform theNFC communication on the LCD 16 (S202), like the first illustrativeembodiment. Then, the CPU 11 waits for reception of an NFC event fromthe MFP 100 (S301: No), like the processing of S203. In S301, when theCPU 11 receives an NFC event (S301: Yes), the CPU 11 executes processingfor connecting the wireless LAN communication unit 23 and the wirelessLAN communication unit 123 of the MFP 100 (S302) by the directconnection. Specifically, in S302, the CPU 11 sets an SSID for directreceived together with the NFC event, as the wireless setting forperforming Wi-Fi communication through the wireless LAN communicationunit 23. Incidentally, the ‘SSID for direct’ is an SSID that is usedwhen establishing the direct connection with the MFP 100, and is aso-called one time SSID allowing the connection with the wireless LANcommunication unit 123 on condition that the SSID is used only one time.In this illustrative embodiment, the MFP 100 issues the SSID for directto the portable device 10.

The CPU 11 determines whether a screen displayed on the LCD 16 is aprint preview screen (S303). When the CPU 11 determines that a printpreview screen is displayed on the LCD 16 (S303: Yes), the CPU 11transmits print data, which includes the image data selected as a printtarget and the print setting set in the portable device 10, to the MFP100 (S304) connected by the direct connection. The MFP 100 havingreceived the print data enables a printer unit (not shown) to execute aprinting operation based on the received print data. After theprocessing of S304, the CPU 11 executes the SSID transmission processing(S204), like the first illustrative embodiment. When the SSIDtransmission processing (S204) is executed, the SSID, which is set asthe SSID for transmission in the SSID designation processing (S201), istransmitted to the MFP 100 having no SSID set therein by the NFCcommunication, like the first illustrative embodiment. On the otherhand, when the CPU 11 determines in S303 that a print preview screen isnot displayed on the LCD 16 (S303: No), the CPU 11 skips over theprocessing of S304 and executes the SSID transmission processing (S204).

Then, the CPU 11 determines whether the connection with the MFP 100 bythe infrastructure connection is completed (S305). In S305, when the CPU11 sends an inquiry to the IP address allotted to the MFP 100, which isa destination, through the AP specified by the SSID transmitted to theMFP 100 every predetermined time (for example, every one seconds) andreceives a reply to the inquiry, the CPU 11 determines that theconnection with the MFP 100 by the infrastructure connection iscompleted. Incidentally, the IP address allotted to the MFP 100 isreceived from the MFP 100 through the NFC communication, together withthe NFC event. Alternatively, when the SSID received from the portabledevice 10 is set in the MFP 100, a signal indicating that theinfrastructure connection is completed may be transmitted to the IPaddress allotted to the portable device 10, which is a destination,through the infrastructure-connected AP 30. In this case, the CPU 11transmits the IP address allotted to the portable device 10 to the MFP100 through the NFC communication when the antenna unit of the nearfield communication unit 22 of the portable device 10 is enabled to comeclose to the antenna unit of the near field communication unit 122 ofthe MFP 100.

The CPU 11 waits for the completion of the infrastructure connectionuntil the CPU 11 determines that the connection with the MFP 100 by theinfrastructure connection is completed (S305: No). On the other hand,when the CPU 11 determines that the connection with the MFP 100 by theinfrastructure connection is completed (S305: Yes), the CPU 11associates and stores the IP address, which is allotted to the MFP 100with being associated with the SSID transmitted to the MFP 100, and themodel name of the MFP 100 in the storage area 12 d for an application(S306) and ends this processing. Incidentally, the model name of the MFP100 may be received from the MFP 100 through the NFC communicationtogether with the NFC event, for example, or may be received through theWi-Fi communication after the connection with the MFP 100 by theinfrastructure connection is completed.

According to the second illustrative embodiment, it is possible toenable the MFP 100 to execute the printing operation and to set the SSIDin the MFP 100. That is, the setting application 12 c of the secondillustrative embodiment is configured as a printing application havingthe wireless setting function.

In the below, a third illustrative embodiment will be described withreference to FIG. 3B. In the second illustrative embodiment, the MFP 100and the AP 30 are infrastructure-connected. In the third illustrativeembodiment, the mode of the wireless connection of the MFP 100 iscontrolled depending on the screen that is displayed on the LCD 16. Inthe third illustrative embodiment, the same parts as the first or secondillustrative embodiment are denoted with the same reference numerals andthe descriptions thereof are omitted.

Like the second illustrative embodiment, the printing processing of thethird illustrative embodiment also starts when the setting application12 c is enabled to start up and the image data is selected as a printtarget. When this processing starts, the CPU 11 displays the UIprompting the user to perform the NFC communication on the LCD 16(S202). Then, the CPU 11 waits for reception of an NFC event from theMFP 100 (S301: No). When the CPU 11 receives an NFC event in S301 (S301:Yes) and when the CPU 11 determines that a print preview screen isdisplayed on the LCD 16 (S303: Yes), the CPU 11 executes processing forconnecting the wireless LAN communication unit 23 of the portable device10 and the wireless LAN communication unit 123 of the MFP 100 by thedirect connection (S302) and transmits the print data to the MFP 100connected by the direct connection (S304). Meanwhile, in thisillustrative embodiment, it is assumed that the portable device 10issues the SSID for direct to the MFP 100. Hence, in this illustrativeembodiment, in S302, the CPU 11 issues an SSID for direct and transmitsthe SSID for direct to the MFP 100 through the NFC communication. Whenthe MFP 100 receives the SSID for direct, the MFP 100 sets the receivedSSID for direct as the wireless setting for performing Wi-Ficommunication with the portable device 10. Thereby, the portable device10 and the MFP 100 are connected by the direct connection.

On the other hand, when the CPU 11 determines in S303 that a printpreview screen is not displayed on the LCD 16 (S303: No), the CPU 11executes the SSID designation processing (S201) and the SSIDtransmission processing (S204), like the first illustrative embodiment.Then, the CPU 11 waits for the completion of the connection with the MFP100 by the infrastructure connection (S305: No). When the CPU 11determines that the connection with the MFP 100 by the infrastructureconnection is completed (S305: Yes), the CPU 11 associates and storesthe IP address, which is allotted to the MFP 100 with being associatedwith the SSID transmitted to the MFP 100, and the model name of the MFP100 in the storage area 12 d for an application (S306) and ends thisprocessing.

According to the third illustrative embodiment, when the print previewscreen is displayed on the LCD 16, the SSID for direct having alimitation on the number of connection times and securing sufficientsecurity is used irrespective of whether the SSID is set in the MFP 100,and the print data is transmitted by the direct connection, so that itis possible to enable the MFP 100 to execute the printing. Hence, it ispossible to rapidly execute the printing conforming to the user'sintention having displayed the print preview screen. On the other hand,when the print preview screen is not displayed on the LCD 16, if an SSIDis not set in the MFP 100, the SSID (the SSID of the AP 30) set as theSSID for transmission by the SSID designation processing (S201) istransmitted to the MFP 100 through the NFC communication. Hence, whenthe print preview screen is not displayed, the user can transmit and setthe SSID in the MFP 100.

In the respective illustrative embodiments, the setting application 12 cis an example of the communication program. The portable device 10 is anexample of the communication apparatus. The MFP 100 is an example of theexternal apparatus. The AP 30 is an example of the relay apparatus. Thenear field communication unit 22 is an example of the firstcommunication unit. The wireless LAN communication unit 23 is an exampleof the second communication unit. The CPU 11 is an example of thecontroller. The flash memory 12 is an example of the storage unit. Thestorage area 12 d for an application is an example of the first storagearea. The storage area 12 b for an OS is an example of the secondstorage area. The LCD 16 is an example of the display unit. The OS 12 ais an example of the program other than the communication program. TheSSID of the AP 30 and the SSID for direct are examples of the wirelesssetting for performing wireless setting by the specific wirelesscommunication method. The SSID for direct is an example of the firstwireless setting. The SSID of the AP 30 is an example of the secondwireless setting. The UI displayed in S225 is an example of theselection screen. The UI displayed in S245 is an example of the inquiryscreen. The print preview screen is an example of the predeterminedscreen. The CPU 11 that executes the processing of S242 is an example ofthe first determination process. The CPU 11 that executes the processingof S221 is an example of the first storage determination process. TheCPU 11 that executes the processing of S224 and S243 is an example ofthe wireless setting transmission process. The CPU 11 that executes theprocessing of S223 is an example of the second determination process.The CPU 11 that executes the processing of S202, S225 and S245 is anexample of the display control process. The CPU 11 that executes theprocessing of S226 is an example of the selection receiving process. TheCPU 11 that executes the processing of S229 is an example of the firststorage control process. The CPU 11 that executes the processing of S244is an example of the second storage control process. The CPU 11 thatexecutes the processing of S222 is an example of the second storagedetermination process. The CPU 11 that executes the processing of S246is an example of the input receiving process. The CPU 11 that executesthe processing of S303 is an example of the third determination process.

Although the invention has been described with reference to theillustrative embodiments, the invention is not limited to theillustrative embodiments and a variety of improvements and modificationscan be easily conceived without departing from the gist of theinvention.

For example, in the respective illustrative embodiments, the portabledevice 10 such as a smart phone has been exemplified as thecommunication apparatus having the device control application 12 cmounted therein. However, a variety of apparatuses can be adopted as thecommunication apparatus insofar as it can perform wireless communicationby the NFC communication and the Wi-Fi communication. For example, whenan apparatus such as a tablet computer, a note-type PC, a digital cameraand a music reproduction apparatus is configured to perform wirelesscommunication by the NFC communication and the Wi-Fi communication, thecorresponding apparatus can be adopted as the communication apparatushaving the device control application 12 c mounted therein. Also, in therespective illustrative embodiments, the OS 12 a of the portable device10 is the Android OS. However, the other OS may be also adopted.

In the second and third illustrative embodiments, the settingapplication 12 c is configured to also serve as the application forusing the printing function of the MFP 100. However, the settingapplication 12 c may be configured to also serve as an application forusing a function other than the printing function of the MFP 100, forexample the scan function. Also, the setting application 12 c is notlimited to the application for using the function of the MFP 100 and maybe configured to also serve as other application, for example, anapplication for transmitting and receiving data having a relativelysmall size such as setting data through the NFC communication and thentransmitting and receiving data having a relatively large size such asimage data through the Wi-Fi communication. Also, in the respectiveillustrative embodiments, the MFP 100 having the multiple functions suchas the printing function has been exemplified as the external apparatus.However, an apparatus specialized to a single function such as a printerand a scanner and a PC having a saving function and the like may be alsoadopted as the external apparatus.

In the respective illustrative embodiments, the IP address and the modelname have been exemplified as the apparatus information for specifyingthe MFP 100 of the wireless communication destination in the Wi-Ficommunication by the infrastructure connection. However, only the IPaddress may be used. Also, instead of the IP address, a node name, a MACaddress and the like may be used as the apparatus information.Incidentally, the timing at which the apparatus information is acquiredis not limited to the timing at which the NFC event is received and theapparatus information may be received at appropriate timing. Also, thetransmission and reception of the apparatus information is not limitedto the NFC communication and may be performed through the Wi-Ficommunication when the infrastructure connection is completed after theportable device 10 transmits the SSID to the MFP 100.

In the respective illustrative embodiments, the SSID for direct is theSSID having the condition that it is used only one time. However, thenumber of using times may not be limited to one time and may be two ormore times inasmuch as the security can be secured. Also, the connectionlimitation of the SSID for direct may be defined by a time element suchas elapsed time after the SSID is issued, not by the number of usingtimes such as one time.

In the respective illustrative embodiments, the SSID that is stored inthe storage area 12 d for an application is limited to the SSID of theAP, i.e., the SSID (hereinafter, referred to as the ‘SSID forinfrastructure’) for infrastructure connection through the AP 30.However, when the portable device 10 and the MFP 100 are connected bythe direct connection, the SSID for direct for the direct connection maybe stored in the storage area 12 d for an application. In this case, theSSID for direct stored in the storage area 12 d for an application maybe deleted when a predetermined condition such as the number of usingtimes and elapsed time after the SSID is stored is satisfied.

In the respective illustrative embodiments, since the SSID that isstored in the storage area 12 d for an application is limited to theSSID for infrastructure, all the SSIDs that are set as the SSID fortransmission in the SSID designation processing (S201) are also theSSIDs for infrastructure. That is, in S242 of the SSID transmissionprocessing (S204), when the connection state of the MFP is not set yetor is invalid, the SSID for infrastructure is transmitted to the MFP100. Instead of this, as described above, in the modified embodiment inwhich the SSID for direct is stored in the storage area 12 d for anapplication, the SSID for direct stored in the storage area 12 d for anapplication may be set as the SSID for transmission in the SSIDdesignation processing (S201) and then the SSID for direct may betransmitted to the MFP 100 in the SSID transmission processing (S204).Alternatively, in order to connect the portable device 10 and the MFP100 by the direct connection, the SSID for direct temporarily stored inthe temporary area of the RAM 13 may be added to the SSID, which isstored in the storage area 12 d for an application, so that it is set asone of the SSIDs to be designated in the SSID designation processing(S201).

In the respective illustrative embodiments, the SSID of the AP of aninvalid state, i.e., to be currently non-connectable of the SSIDs storedin the storage area 12 d for an application is not transmitted to theMFP 100. However, when there is no SSID of a valid state of the SSIDsstored in the storage area 12 d for an application, the SSID of aninvalid state may be transmitted to the MFP 100.

In the second illustrative embodiment, the portable device 10 isconnected to the MFP 100 by the direct connection by using the SSID fordirect received from the MFP 100. However, like the third illustrativeembodiment, the portable device 10 may issue an SSID for direct andtransmit the issued SSID for direct to the MFP 100, thereby establishingthe direct connection. Meanwhile, also in the third illustrativeembodiment, the portable device 10 may be connected to the MFP 100 bythe direct connection by using the SSID for direct received from the MFP100, like the second illustrative embodiment.

In the first and second illustrative embodiments, the SSID designationprocessing (S201) is executed before the NFC communication is performedbetween the portable device 10 and the MFP 100. However, like the thirdillustrative embodiment, the SSID designation processing (S201) may beexecuted after the NFC communication is performed between the portabledevice 10 and the MFP 100. Meanwhile, also in the third illustrativeembodiment, the SSID designation processing (S201) may be executedbefore the NFC communication is performed between the portable device 10and the MFP 100. Incidentally, the configuration where the SSIDdesignation processing (S201) is executed before the NFC communicationis performed between the portable device 10 and the MFP 100 is moreconvenient to the user because it is not necessary to bring the portabledevice 10 close to the MFP 100 so as to perform the NFC communication.

In the respective illustrative embodiments, when there is no transmittedSSID, the processing of S223 is executed. Alternatively, even when thereis a transmitted SSID, the processing of S223 may be executed. That is,in the SSID designation processing of FIG. 2B, the processing of S222may be omitted.

In the respective illustrative embodiments, the CPU 11 executes therespective processing of FIGS. 2 and 3. However, a plurality of CPUs maycooperatively execute the respective processing of FIGS. 2 and 3. Also,a single IC such as ASIC may independently or multiple ICs maycooperatively execute the respective processing of FIGS. 2 and 3. Also,the CPU 11 and the IC such as ASIC may cooperatively execute therespective processing of FIGS. 2 and 3.

The respective features described in the first and third illustrativeembodiments and the respective modified embodiments may be appropriatelycombined.

Illustrative embodiments of the invention can provide at least thefollowing advantages.

(1) According to the above-described non-transitory computer-readablemedium, in the case where it is determined that the wireless setting forperforming wireless communication by the wireless communication methodis not set in the external apparatus and in the case where the wirelesssetting, which is settable by the communication apparatus mounting thecommunication program therein, is stored in the first storage areaallotted to the communication program, the wireless setting stored inthe first storage area is transmitted to the external apparatus throughthe first communication unit. Hence, the external apparatus can easilyset the wireless setting for performing wireless communication by thewireless communication method, compared to a configuration where a usermanually inputs and sets the wireless setting one by one. Also, thewireless setting is transmitted to the external apparatus on conditionthat it is determined that the wireless setting for performing wirelesscommunication by the wireless communication method is not set in theexternal apparatus. Hence, it is possible to suppress the set wirelesssetting from being inadvertently rewritten with the wireless settingtransmitted by the communication apparatus (i.e., received by theexternal apparatus) even though the wireless setting for performingwireless communication by the wireless communication method is set inthe external apparatus.

(2) In the case where it is determined that the wireless setting, whichis settable by the communication apparatus, is stored in the firststorage area, the wireless setting of a valid state of the wirelesssettings stored in the first storage area, which can performcommunication with the relay apparatus performing wireless communicationwith the external apparatus by the wireless communication by thewireless communication method, is transmitted to the external apparatusthrough the first communication unit. Hence, it is possible to set thewireless setting capable of performing communication with the relayapparatus by the wireless communication of the wireless communicationmethod in the external apparatus.

(3) In the case where there are the multiple wireless settings of avalid state, which can perform communication with the relay apparatus bythe wireless communication of the wireless communication method, of thewireless settings stored in the first storage area, the selection screenfor selecting a wireless setting, which is to be transmitted to theexternal apparatus, from the multiple wireless settings of a valid stateis displayed on the display unit. Thus, it is possible to set thewireless setting, which is optimal depending on situations, of thewireless settings capable of performing communication with the relayapparatus by the wireless communication of the wireless communicationmethod in the external apparatus.

(4) In the case where the wireless setting stored in the first storagearea is not the wireless setting of a valid state capable of performingcommunication with the relay apparatus, which performs wirelesscommunication with the external apparatus, by the wireless communicationof the wireless communication method, the wireless setting, which isstored in the second storage area allotted to the program other than thecommunication program and is set as the wireless setting for performingwireless communication through the second communication unit, istransmitted to the external apparatus through the first communicationunit. Therefore, it is possible to set the wireless setting, which isset in the communication apparatus, in the external apparatus, therebyperforming wireless communication by the wireless communication methodbetween the external apparatus and the communication apparatus.

(5) In the case where it is determined that the wireless setting, whichis settable by the communication apparatus, is not stored in the firststorage area, the wireless setting, which is stored in the secondstorage area to be used by the program other than the communicationprogram and is set as the wireless setting for performing wirelesscommunication through the second communication unit, is transmitted tothe external apparatus through the first communication unit. Thus, it ispossible to set the wireless setting, which is set in the communicationapparatus, in the external apparatus, thereby performing wirelesscommunication by the wireless communication method between the externalapparatus and the communication apparatus.

(6) In the case where the wireless setting, which is stored in thesecond storage area and is set as the wireless setting for performingwireless communication by the wireless communication method, istransmitted to the external apparatus, the wireless setting is stored inthe first storage area. Hence, since it is possible to use the wirelesssetting, which is used by the program other than the communicationprogram, by the communication program, it is possible to use thewireless setting at any time by the communication program.

(7) In the case where the wireless setting is transmitted to theexternal apparatus, it is possible to associate the wireless settingwith the transmission completion information capable of specifying thatthe wireless setting has been transmitted. In the case where it isdetermined that the wireless setting associated with the transmissioncompletion information is stored in the first storage area, the wirelesssetting associated with the transmission completion information istransmitted to the external apparatus through the first communicationunit. Hence, it is possible to set the same wireless setting in themultiple external apparatuses.

(8) In the case where the wireless setting incapable of performing therelay apparatus, which performs wireless communication with the externalapparatus, by the wireless communication method is set in the externalapparatus, it is determined that the wireless setting is not set in theexternal apparatus. Hence, in this case, since the wireless setting istransmitted by the wireless setting transmission process, it is possibleto set the wireless setting transmitted by the communication apparatusin the external apparatus. At this time, in the case where the wirelesssetting transmitted by the communication apparatus enables the wirelesscommunication with the relay apparatus by the wireless communicationmethod, it is possible to enable the external apparatus, which cannotperform the relay apparatus by the wireless communication of thewireless communication method, to be at a state where the externalapparatus can perform wireless communication with the relay apparatus bythe wireless communication of the wireless communication method.

(9) In the case where it is determined that the wireless setting forperforming wireless communication by the wireless communication methodis set in the external apparatus, the inquiry screen inquiring whetheror not to transmit the wireless setting stored in the first storage areato the external apparatus is displayed on the display unit. Then, in thecase where the transmission to the external apparatus is selected on theselection screen, the wireless setting stored in the first storage areais transmitted to the external apparatus through the first communicationunit. Hence, even when the wireless setting for performing wirelesscommunication by the wireless communication method is set in theexternal apparatus, it is possible to set the wireless setting stored inthe first storage area in the external apparatus in accordance with theuser's intention.

(10) In the case where the predetermined screen is displayed on thedisplay unit, it is possible to enable the external apparatus to executea function corresponding to the predetermined screen displayed on thedisplay unit by using the wireless setting (the first wireless setting)having a limitation on connection time or the number of connection timesto thus secure sufficient security and for performing wirelesscommunication with the external apparatus without using the relayapparatus, irrespective of whether the wireless setting is set in theexternal apparatus. Therefore, it is possible to rapidly execute thefunction in accordance with the user's intention having displayed thepredetermined screen. On the other hand, in the case where thepredetermined screen is not displayed on the display unit, if thewireless setting is not set in the external apparatus, the wirelesssetting (the second wireless setting), which is stored in the firststorage area and is settable by the communication apparatus, forperforming wireless communication with the relay apparatus capable ofperforming wireless communication with the external apparatus istransmitted to the external apparatus through the first communicationunit. Therefore, in the case where the predetermined screen is notdisplayed, the user is able to set the second wireless setting, which isstored in the first storage area, in the external apparatus.

(11) According to the above-described communication apparatus, it ispossible to obtain the same advantages as the above-describednon-transitory computer-readable medium.

1. A non-transitory computer-readable medium having a communicationprogram stored thereon and readable by a controller of a communicationapparatus, wherein the communication apparatus comprises: a firstcommunication unit configured to perform communication by a near fieldcommunication method; a second communication unit configured to performcommunication by a wireless communication method that is different fromthe near field communication method; a storage unit storing a wirelesssetting; and the controller, the communication program, when executed bythe controller, causes the controller to perform operations comprising:a first determination process of determining whether a wireless settingfor performing wireless communication by the wireless communicationmethod is set in an external apparatus in a case where the communicationapparatus is in communication with the external apparatus through thefirst communication unit; a second determination process of determiningwhether the wireless setting stored in the storage unit is a wirelesssetting of a valid state capable of performing communication with arelay apparatus, which performs wireless communication with the externalapparatus, by the wireless communication of the wireless communicationmethod; and a wireless setting transmission process of transmitting thewireless setting stored in the storage unit, which is determined as thewireless setting of a valid state by the second determination process,to the external apparatus through the first communication unit in a casewhere the first determination process determines that the wirelesssetting is not set in the external apparatus.
 2. The non-transitorycomputer-readable medium according to claim 1, wherein the communicationapparatus comprises a display unit, wherein the operations furthercomprise: a display control process of displaying a screen on thedisplay unit, wherein in a case where there is a plurality of wirelesssettings stored in the storage unit, which are determined as thewireless setting of a valid state by the second determination process,the display control process displays on the display unit a selectionscreen for enabling a wireless setting, which is to be transmitted tothe external apparatus, to be selected from the wireless settings of avalid state, wherein the operations further comprise: a selectionreceiving process of receiving a selection of the wireless setting,which is to be transmitted to the external apparatus, made on theselection screen displayed on the display unit, and wherein the wirelesssetting transmission process transmits the wireless setting, theselection of which is received by the selection receiving process, tothe external apparatus through the first communication unit.
 3. Thenon-transitory computer-readable medium according to claim 1, whereinthe storage unit comprises a first storage area that is allotted to thecommunication program and a second storage area that is allotted to aprogram other than the communication program, wherein the operationsfurther comprise a first storage determination process of determiningwhether a wireless setting, which is settable by the communicationapparatus, is stored in the first storage area, wherein the seconddetermination process comprises, in the case where the first storagedetermination process determines that the wireless setting that issettable by the communication apparatus is stored in the first storagearea, determining whether the wireless setting stored in the firststorage area is a wireless setting of a valid state capable ofperforming communication with a relay apparatus, which performs wirelesscommunication with the external apparatus, by the wireless communicationof the wireless communication method, and wherein in a case where thesecond determination process determines that the wireless setting storedin the first storage area is not the wireless setting of a valid state,the wireless setting transmission process transmits the wirelesssetting, which is stored in the second storage area and is set as thewireless setting for performing wireless communication by the wirelesscommunication method, to the external apparatus through the firstcommunication unit.
 4. The non-transitory computer-readable mediumaccording to claim 1, wherein the storage unit comprises a first storagearea that is allotted to the communication program and a second storagearea that is used by a program other than the communication program,wherein the operations further comprise a first storage determinationprocess of determining whether a wireless setting, which is settable bythe communication apparatus, is stored in the first storage area, andwherein in a case where the first storage determination processdetermines that the wireless setting, which is settable by thecommunication apparatus, is not stored in the first storage area, thewireless setting transmission process transmits the wireless setting,which is stored in the second storage area and is set as the wirelesssetting for performing wireless communication by the wirelesscommunication method, to the external apparatus through the firstcommunication unit.
 5. The non-transitory computer-readable mediumaccording to claim 3, wherein the operations further comprise: a firststorage control process of storing the wireless setting transmitted tothe external apparatus by the wireless setting transmission process,which is stored in the second storage area and is set as the wirelesssetting for performing wireless communication by the wirelesscommunication method, in the first storage area.
 6. The non-transitorycomputer-readable medium according to claim 4, wherein the operationsfurther comprise: a first storage control process of storing thewireless setting transmitted to the external apparatus by the wirelesssetting transmission process, which is stored in the second storage areaand is set as the wireless setting for performing wireless communicationby the wireless communication method, in the first storage area.
 7. Thenon-transitory computer-readable medium according to claim 1, whereinthe operations further comprise: a second storage control process of, ina case where the wireless setting is transmitted to the externalapparatus by the wireless setting transmission process, associating andstoring the wireless setting and transmission completion informationcapable of specifying that the wireless setting has been transmitted;and a second storage determination process of determining whether thewireless setting associated with the transmission completion informationis stored in the storage unit, and wherein in a case where the secondstorage determination process determines that the wireless settingassociated with the transmission completion information is stored in thestorage unit, the wireless setting transmission process transmits thewireless setting associated with the transmission completion informationto the external apparatus through the first communication unit.
 8. Thenon-transitory computer-readable medium according to claim 1, wherein ina case where (a) the wireless setting for performing wirelesscommunication by the wireless communication method is set in theexternal apparatus and (b) the wireless setting is not a wirelesssetting of a valid state capable of performing communication with arelay apparatus, which performs wireless communication with the externalapparatus, by the wireless communication of the wireless communicationmethod, the first determination process determines that the wirelesssetting is not set.
 9. The non-transitory computer-readable mediumaccording to claim 1, wherein the communication apparatus comprises adisplay unit, wherein the operations further comprise: a display controlprocess of displaying a screen on the display unit, wherein in a casewhere the first determination process determines that the wirelesssetting is set in the external apparatus, the display control processdisplays, on the display unit, an inquiry screen inquiring whether ornot to transmit the wireless setting stored in the storage unit to theexternal apparatus, wherein the operations further comprise: an inputreceiving process of receiving an input to the inquiry screen displayedon the display unit, and wherein in a case where an input received bythe input receiving process indicates that the wireless setting storedin the storage unit is to be transmitted to the external apparatus, thewireless setting transmission process transmits the wireless settingstored in the storage unit to the external apparatus through the firstcommunication unit.
 10. The non-transitory computer-readable mediumaccording to claim 1, wherein the communication apparatus comprises adisplay unit, wherein the wireless setting comprises: a first wirelesssetting having a limitation on connection time or a number of connectiontimes and for performing wireless communication with the externalapparatus without using a relay apparatus; and a second wireless settingfor performing wireless communication with a relay apparatus configuredto perform wireless communication with the external apparatus, whereinthe operations further comprise: a function execution process ofperforming communication corresponding to a predetermined function,which is executable by the external apparatus, with the externalapparatus by the wireless communication through the second communicationunit so as to execute the predetermined function; and a thirddetermination process of determining whether a predetermined screen ofscreens relating to the predetermined function, which is executable bythe external apparatus, is displayed on the display unit, wherein oncondition that the third determination process determines that thepredetermined screen is displayed on the display unit, the functionexecution process performs communication with the external apparatus byusing the first wireless setting and through the second communicationunit, in accordance with a function corresponding to the predeterminedscreen, and wherein on condition that the third determination processdetermines that the predetermined screen is not displayed on the displayunit, in a case where the first determination process determines thatthe wireless setting is not set in the external apparatus, the wirelesssetting transmission process transmits the second wireless settingstored in the storage unit to the external apparatus through the firstcommunication unit.
 11. A non-transitory computer-readable medium havinga communication program stored thereon and readable by a controller of acommunication apparatus, wherein the communication apparatus comprises:a first communication unit configured to perform communication by a nearfield communication method; a second communication unit configured toperform communication by a wireless communication method that isdifferent from the near field communication method; a storage unitstoring a wireless setting; and the controller, the communicationprogram, when executed by the controller, causes the controller toperform operations comprising: a first determination process ofdetermining whether a wireless setting for performing wirelesscommunication by the wireless communication method is set in an externalapparatus in a case where the communication apparatus is incommunication with the external apparatus through the firstcommunication unit; a wireless setting transmission process oftransmitting the wireless setting stored in the storage unit to theexternal apparatus through the first communication unit in a case wherethe first determination process determines that the wireless setting isnot set in the external apparatus; a second storage control process of,in a case where the wireless setting is transmitted to the externalapparatus by the wireless setting transmission process, associating andstoring the wireless setting and transmission completion informationcapable of specifying that the wireless setting has been transmitted;and a storage determination process of determining whether the wirelesssetting associated with the transmission completion information isstored in the storage unit, and wherein in a case where the storagedetermination process determines that the wireless setting associatedwith the transmission completion information is stored in the storageunit, the wireless setting transmission process transmits the wirelesssetting associated with the transmission completion information to theexternal apparatus through the first communication unit.
 12. Anon-transitory computer-readable medium having a communication programstored thereon and readable by a controller of a communicationapparatus, wherein the communication apparatus comprises: a firstcommunication unit configured to perform communication by a near fieldcommunication method; a second communication unit configured to performcommunication by a wireless communication method that is different fromthe near field communication method; a storage unit storing a wirelesssetting; and the controller, the communication program, when executed bythe controller, causes the controller to perform operations comprising:a first determination process of determining whether a wireless settingfor performing wireless communication by the wireless communicationmethod is set in an external apparatus and the wireless setting is not awireless setting of a valid state capable of performing communicationwith a relay apparatus, which performs wireless communication with theexternal apparatus, by the wireless communication of the wirelesscommunication method in a case where the communication apparatus is incommunication with the external apparatus through the firstcommunication unit; and a wireless setting transmission process oftransmitting the wireless setting to the external apparatus through thefirst communication unit in a case where the first determination processdetermines that the wireless setting is not the wireless setting of avalid state.
 13. The non-transitory computer-readable medium accordingto claim 12, wherein the storage unit comprises a first storage areathat is allotted to the communication program and a second storage areathat is allotted to a program other than the communication program,wherein the operations further comprise: a first storage determinationprocess of determining whether a wireless setting, which is settable bythe communication apparatus, is stored in the first storage area; and asecond determination process of, in the case where the first storagedetermination process determines that the wireless setting that issettable by the communication apparatus is stored in the first storagearea, determining whether the wireless setting stored in the firststorage area is the wireless setting of a valid state, and wherein in acase where the second determination process determines that the wirelesssetting stored in the first storage area is not the wireless setting ofa valid state, the wireless setting transmission process transmits thewireless setting, which is stored in the second storage area and is setas the wireless setting for performing wireless communication by thewireless communication method, to the external apparatus through thefirst communication unit.
 14. The non-transitory computer-readablemedium according to claim 12, wherein the storage unit comprises a firststorage area that is allotted to the communication program and a secondstorage area that is used by a program other than the communicationprogram, wherein the operations further comprise: a first storagedetermination process of determining whether a wireless setting, whichis settable by the communication apparatus, is stored in the firststorage area, wherein in a case where the first storage determinationprocess determines that the wireless setting, which is settable by thecommunication apparatus, is not stored in the first storage area, thewireless setting transmission process transmits the wireless setting,which is stored in the second storage area and is set as the wirelesssetting for performing wireless communication by the wirelesscommunication method, to the external apparatus through the firstcommunication unit.
 15. The non-transitory computer-readable mediumaccording to claim 12, wherein the operations further comprise: a secondstorage control process of, in a case where the wireless setting istransmitted to the external apparatus by the wireless settingtransmission process, associating and storing the wireless setting andtransmission completion information capable of specifying that thewireless setting has been transmitted; and a second storagedetermination process of determining whether the wireless settingassociated with the transmission completion information is stored in thestorage unit, and wherein in a case where the second storagedetermination process determines that the wireless setting associatedwith the transmission completion information is stored in the storageunit, the wireless setting transmission process transmits the wirelesssetting associated with the transmission completion information to theexternal apparatus through the first communication unit.
 16. Thenon-transitory computer-readable medium according to claim 12, whereinthe communication apparatus comprises a display unit, wherein theoperations further comprise: a display control process of displaying ascreen on the display unit, wherein in a case where the firstdetermination process determines that the wireless setting is set in theexternal apparatus, the display control process displays, on the displayunit, an inquiry screen inquiring whether or not to transmit thewireless setting stored in the storage unit to the external apparatus,wherein the operations further comprise: an input receiving process ofreceiving an input to the inquiry screen displayed on the display unit,and wherein in a case where an input received by the input receivingprocess indicates that the wireless setting stored in the storage unitis to be transmitted to the external apparatus, the wireless settingtransmission process transmits the wireless setting stored in thestorage unit to the external apparatus through the first communicationunit.
 17. The non-transitory computer-readable medium according to claim12, wherein the communication apparatus comprises a display unit,wherein the wireless setting comprises: a first wireless setting havinga limitation on connection time or a number of connection times and forperforming wireless communication with the external apparatus withoutusing a relay apparatus; and a second wireless setting for performingwireless communication with a relay apparatus configured to performwireless communication with the external apparatus, wherein theoperations further comprise: a function execution process of performingcommunication corresponding to a predetermined function, which isexecutable by the external apparatus, with the external apparatus by thewireless communication through the second communication unit so as toexecute the predetermined function; and a third determination process ofdetermining whether a predetermined screen of screens relating to thepredetermined function, which is executable by the external apparatus,is displayed on the display unit, wherein on condition that the thirddetermination process determines that the predetermined screen isdisplayed on the display unit, the function execution process performscommunication with the external apparatus by using the first wirelesssetting and through the second communication unit, in accordance with afunction corresponding to the predetermined screen, and wherein oncondition that the third determination process determines that thepredetermined screen is not displayed on the display unit, in a casewhere the first determination process determines that the wirelesssetting is not set in the external apparatus, the wireless settingtransmission process transmits the second wireless setting stored in thestorage unit to the external apparatus through the first communicationunit.
 18. A non-transitory computer-readable medium having acommunication program stored thereon and readable by a controller of acommunication apparatus, wherein the communication apparatus comprises:a first communication unit configured to perform communication by a nearfield communication method; a second communication unit configured toperform communication by a wireless communication method that isdifferent from the near field communication method; a storage unitstoring a wireless setting; a display unit; and the controller, thecommunication program, when executed by the controller, causes thecontroller to perform operations comprising: a first determinationprocess of determining whether a wireless setting for performingwireless communication by the wireless communication method is set in anexternal apparatus in a case where the communication apparatus is incommunication with the external apparatus through the firstcommunication unit; a display control process of, in a case where thefirst determination process determines that the wireless setting is setin the external apparatus, displaying, on the display unit, an inquiryscreen inquiring whether or not to transmit the wireless setting storedin the storage unit to the external apparatus; an input receivingprocess of receiving an input to the inquiry screen displayed on thedisplay unit; and a wireless setting transmission process oftransmitting the wireless setting stored in the storage unit to theexternal apparatus through the first communication unit in a case wherethe first determination process determines that the wireless setting isnot set in the external apparatus and an input received by the inputreceiving process indicates that the wireless setting stored in thestorage unit is to be transmitted to the external apparatus.
 19. Anon-transitory computer-readable medium having a communication programstored thereon and readable by a controller of a communicationapparatus, wherein the communication apparatus comprises: a firstcommunication unit configured to perform communication by a near fieldcommunication method; a second communication unit configured to performcommunication by a wireless communication method that is different fromthe near field communication method; a storage unit storing a wirelesssetting, the wireless setting comprising: a first wireless settinghaving a limitation on connection time or a number of connection timesand for performing wireless communication with an external apparatuswithout using a relay apparatus; and a second wireless setting forperforming wireless communication with a relay apparatus configured toperform wireless communication with the external apparatus; a displayunit; and the controller, the communication program, when executed bythe controller, causes the controller to perform operations comprising:a first determination process of determining whether a wireless settingfor performing wireless communication by the wireless communicationmethod is set in an external apparatus in a case where the communicationapparatus is in communication with the external apparatus through thefirst communication unit; a function execution process of performingcommunication corresponding to a predetermined function, which isexecutable by the external apparatus, with the external apparatus by thewireless communication through the second communication unit so as toexecute the predetermined function; a third determination process ofdetermining whether a predetermined screen of screens relating to thepredetermined function, which is executable by the external apparatus,is displayed on the display unit; and a wireless setting transmissionprocess of transmitting the wireless setting stored in the storage unitto the external apparatus through the first communication unit in a casewhere the first determination process determines that the wirelesssetting is not set in the external apparatus, wherein on condition thatthe third determination process determines that the predetermined screenis displayed on the display unit, the function execution processperforms communication with the external apparatus by using the firstwireless setting and through the second communication unit, inaccordance with a function corresponding to the predetermined screen,and wherein on condition that the third determination process determinesthat the predetermined screen is not displayed on the display unit, in acase where the first determination process determines that the wirelesssetting is not set in the external apparatus, the wireless settingtransmission process transmits the second wireless setting stored in thestorage unit to the external apparatus through the first communicationunit.